<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Server extends MY_Controller {
	
	public function serverInfo($id=0){
		$this->load->model('server_model');
		$this->load->model('type_model');
		$data = $this->server_model->serverInfo($id);
		$data['type'] = $this->type_model->allType();
		$this->load->view('server',$data);
	}
	
	public function preferential(){
		$this->getServerListData(1);
	}
	
	public function repair(){
		$this->getServerListData(2);
	}
	
	public function maintenance(){
		$this->getServerListData(3);
	}
	
	protected function getServerListData($classid){
		$this->load->model('server_model');
		$this->load->model('serverCat_model');
		$data;
		if($classid!=1){
			$data['title'] = $this->serverCat_model->name4Classid($classid);
			$data['list'] = $this->server_model->list4Classid($classid);
		}else{
			$data['title']['name'] = '今日优惠';
			$data['list'] = $this->server_model->list4Preferential();
		}
		$this->load->view('control',$data);
	}
	
}
?>